package admin

import database "hft/Database"

type LouPanSwiperCategory struct {
	database.Base
	Name         string          `json:"name,omitempty" gorm:"uniqueIndex:name_type"`
	IsCover      bool            `json:"isCover" gorm:"comment:是否需要封面"`
	Type         int             `json:"type" gorm:"comment:轮播图属于楼盘还是户型,0为全部 1为楼盘 2为户型;uniqueIndex:name_type"`
	IsShow       bool            `json:"isShow" gorm:"comment:是否显示在轮播图分类中"`
	LouPanSwiper []*LouPanSwiper `json:"children" gorm:"foreignKey:Category;references:ID;constraint:OnDelete:SET NULL,OnUpdate:NO ACTION"`
	RoomSwiper   []*RoomSwiper   `json:"room_children" gorm:"foreignKey:Category;references:ID;constraint:OnDelete:SET NULL,OnUpdate:NO ACTION"`
}

func (LouPanSwiperCategory) TableName() string {
	return database.TableNameFormat("lou_pan_swiper_category")
}
